﻿/**
 * Peter
 * Created by: Peter Development Team
 *    http://peter.codeplex.com/
 * 
 * GNU General Public License version 2 (GPLv2)
 *    http://peter.codeplex.com/license
 *
 *  This code is provided on an AS IS basis, with no WARRANTIES,
 *  CONDITIONS or GUARANTEES of any kind.
 *
 **/

using ICSharpCode.AvalonEdit.Document;

namespace Peter.Common.Interfaces
{
   /// <summary>
   /// Interface for a peter document that has text.
   /// </summary>
   public interface IPeterTextDocument : IPeterFileDocument
   {
      /// <summary>
      /// Event that occurs when the text of the document changes.
      /// </summary>
      event TextEventHandler TextChanged;

      /// <summary>
      /// Gets the text of the document.
      /// </summary>
      string Text { get; }

      /// <summary>
      /// Scrolls to the given offset.
      /// </summary>
      /// <param name="offset">Offset to scroll to.</param>
      void ScrollToOffset (int offset);

      /// <summary>
      /// Scrolls the document to the given location.
      /// </summary>
      /// <param name="location">Location to scroll to.</param>
      void ScrollToLocation (TextLocation location);
   }
}
